#include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h>
#include "type.h"

INT32 main(INT32 argc, INT8 **argv)
{
	INT32 running = 1;
	INT32 tStat, pStat;

	while(running){
		tStat = system("lsof -i :3511");
		pStat = system("lsof -i :9999");
		if((tStat != 0)&&(pStat != 0)){
			running = system("./vehicle");
		}else{
			running = system("killall vehicle");
		}
	}

	return 0;
} 
